package com.zkingsoft.zkingbase.presenter;

import com.zkingsoft.zkingbase.view.IBaseView;
import com.zkingsoft.zkingbase.view.INetBaseView;

/**
 * Created by ytf on 2017/3/7 007.
 * Description:
 */

public class UserLoginPresenter<T extends INetBaseView, D> implements IBasePresenter<D>
{

    INetBaseView<D> iView;

    public UserLoginPresenter(INetBaseView view)
    {
        this.iView = view;
    }

    @Override
    public void onStart()
    {
        iView.showProgress(null);
    }

    @Override
    public void onSuccess(D data, Object obj)
    {
        //成功后隐藏等待框
        iView.hideProgress(null);
        iView.loadSuccess(data, obj);
    }

    @Override
    public void onFailed(String msg, Throwable e)
    {
        //失败后隐藏等待框
        iView.hideProgress(null);
        iView.loadFailed(msg, e);
    }

    @Override
    public void onComplete()
    {
        iView.hideProgress(null);
    }
}
